﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TodoApp.ResultModel;
using TodoApp.TMS_SetUp.Departments;
using TodoApp.TMS_SetUp.Positions;
using TodoApp.TMS_SetUp.Roles;
using Volo.Abp.Application.Services;

namespace TodoApp.TMS_personnelmatters.Employeess
{
    public class TMS_EmployeesSevice: ApplicationService
    {
        private readonly ITMS_EmployeesRepository _tMS_EmployeesRepository;
        public TMS_EmployeesSevice(ITMS_EmployeesRepository tMS_EmployeesRepository)
        {
            _tMS_EmployeesRepository = tMS_EmployeesRepository;
        }
        /// <summary>
        /// 分页显示
        /// </summary>
        /// <param name="name"></param>
        /// <param name="department"></param>
        /// <param name="position"></param>
        /// <param name="phone"></param>
        /// <param name="category"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<TMS_EmployeesDto>> GetEmployees(string name, string department, string position, string phone, string category, int pageindex, int pagesize)
        {
            return await _tMS_EmployeesRepository.GetEmployees(name, department, position, phone, category, pageindex, pagesize);
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="tMS_Employees"></param>
        /// <returns></returns>
        public async Task<int> CreateEmployees(TMS_Employees tMS_Employees)
        {
            return await _tMS_EmployeesRepository.CreateEmployees(tMS_Employees);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="tMS_Employees"></param>
        /// <returns></returns>
        public async Task<int> UpdateEmployees(TMS_EmployeesDto tMS_Employees)
        {
            return await _tMS_EmployeesRepository.UpdateEmployees(tMS_Employees);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> DeleteEmployees(string id)
        {
            return await _tMS_EmployeesRepository.DeleteEmployees(id);
        }
        /// <summary>
        /// 学历
        /// </summary>
        /// <returns></returns>
        public async Task<List<TMS_Dictionary>> GetEducationBackground()
        {
            return await _tMS_EmployeesRepository.GetEducationBackground();
        }
        /// <summary>
        /// 婚姻状态
        /// </summary>
        /// <returns></returns>
        public async Task<List<TMS_Dictionary>> GetMarriage()
        {
            return await _tMS_EmployeesRepository.GetMarriage();
        }
        /// <summary>
        /// 员工类别
        /// </summary>
        /// <returns></returns>
        public async Task<List<TMS_Dictionary>> GetCategory()
        {
            return await _tMS_EmployeesRepository.GetCategory();
        }
        /// <summary>
        /// 角色
        /// </summary>
        /// <returns></returns>
        public async Task<List<TMS_Role>> GetRole()
        {
            return await _tMS_EmployeesRepository.GetRole();
        }
        /// <summary>
        /// 部门
        /// </summary>
        /// <returns></returns>
        public async Task<List<TMS_Department>> GetDepartment()
        {
            return await _tMS_EmployeesRepository.GetDepartment();
        }
        /// <summary>
        /// 职位
        /// </summary>
        /// <returns></returns>
        public async Task<List<TMS_Position>> GetPosition()
        {
            return await _tMS_EmployeesRepository.GetPosition();
        }
    }
}
